{extend name="./template/default/m/pub/uc.html" /}
{block name="seo"}
<title>{$site_name}-我的资料</title>
{/block}
{block name="main"}
<div class="app_body">
    <div class="app_wanJiPassWord">
        <div class="app_lisBlockSpan">
            <ul>
                <li>
                    <span class="left">用户名：</span>
                    <input type="text" value="{$user.uname}" disabled="true">
                </li>
                <li>
                    <span class="left">用户邮箱：</span>
                    <input name="email" id="email" type="text" value="{$user.email}" placeholder="请输入您的邮箱">
                </li>
                <li>
                    <span class="left">昵称：</span>
                    <input name="nick_name" id="nick_name" type="text" value="{$user.name}" placeholder="请输入您的昵称">
                </li>
            </ul>
        </div>
        <div class="app_listBlockButton app_marginStyle1" style="padding-bottom: 1.5rem">
            <button id="submitbtn">确认</button>
        </div>
    </div>
</div>
{/block}
{block name="js"}
<script>
    $('#submitbtn').click(function () {
        $.ajax({
            url:'/m/userinfo',
            type:'post',
            data: {
                email: $('#email').val(),
                nick_name: $('#nick_name').val(),
            },
            success:function (res) {
                if (res.err == 0) {
                    layer.msg(res.msg, {icon: 1,time: 1000,shade:0.3}, function () {
                        location.href = '/m/ucenter'
                    })
                } else {
                    layer.msg(res.msg, {icon: 1,time: 1000,shade:0.3})
                }
            }
        })
    })
</script>
{/block}